home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / j / amiga / j41_amig.zoo / changes / j.h < prev    next >
C/C++ Source or Header  |  1992-03-24  |  6KB  |  188 lines

  1. /* ----------------------------------------------------------------------- */
  2. /* J-Source Version 4.1 - COPYRIGHT 1992 Iverson Software Inc.             */
  3. /* 33 Major Street, Toronto, Ontario, Canada, M5S 2K9, (416) 925 6096      */
  4. /*                                                                         */
  5. /* J-Source is provided "as is" without warranty of any kind.              */
  6. /*                                                                         */
  7. /* J-Source Version 4.1 license agreement:  You may use, copy, and         */
  8. /* modify the source.  You have a non-exclusive, royalty-free right        */
  9. /* to redistribute source and executable files.                            */
  10. /* ----------------------------------------------------------------------- */
  11.  
  12. /*                                                                         */
  13. /* Global Definitions                                                      */
  14.  
  15.  
  16. #define SYS_AMIGA               1L
  17. #define SYS_ARCHIMEDES          2L
  18. #define SYS_ATARIST             4L
  19. #define SYS_ATT3B1              8L
  20. #define SYS_HPPA                16L   
  21. #define SYS_IBMRS6000           32L   
  22. #define SYS_MACINTOSH           64L   
  23. #define SYS_MIPSR3000           128L  
  24. #define SYS_NEXT                256L  
  25. #define SYS_PCAT                512L  
  26. #define SYS_PC386               1024L 
  27. #define SYS_SGIIRIX             2048L 
  28. #define SYS_SUN3                4096L 
  29. #define SYS_SUN386I             8192L 
  30. #define SYS_SUN4                16384L
  31. #define SYS_VAX                 32768L
  32. #define SYS_386IX               65536L
  33.  
  34. #define SYS                     SYS_AMIGA
  35. #define LINKJ                   0
  36. #define WATERLOO                0
  37.  
  38. #define SYS_ANSILIB             (SYS_AMIGA + SYS_ARCHIMEDES + SYS_HPPA + \
  39.                                  SYS_IBMRS6000 + SYS_MACINTOSH + SYS_PCAT + \
  40.                                  SYS_PC386 + SYS_VMCMS)
  41. #define SYS_SESM                (SYS_ARCHIMEDES + SYS_PCAT + SYS_MACINTOSH)
  42. #define SYS_UNIX                (SYS_ATT3B1 + SYS_HPPA + SYS_IBMRS6000 + \
  43.                                  SYS_MIPSR3000 + SYS_NEXT + SYS_SGIIRIX + \
  44.                                  SYS_SUN3 + SYS_SUN386I + SYS_SUN4 + \
  45.                                  SYS_VAX + SYS_386IX)
  46. #define SYS_LILENDIAN           (SYS_ARCHIMEDES + SYS_ATT3B1 + SYS_PCAT + \
  47.                                  SYS_PC386 + SYS_SUN386I + SYS_386IX)
  48.  
  49.  
  50. #if (SYS & SYS_ATARIST)
  51. #define __NO_INLINE__           1
  52. #endif
  53.  
  54. #if (SYS & SYS_UNIX)
  55. #include <memory.h>
  56. #include <sys/types.h>
  57. #endif
  58.  
  59. #if (SYS & SYS_ANSILIB)
  60. #include <float.h>
  61. #include <limits.h>
  62. #include <stdlib.h>
  63. #endif
  64.  
  65. #include <errno.h>
  66. #include <math.h>
  67. #include <signal.h>
  68. #include <stdio.h>
  69. #include <string.h>
  70. #include <time.h>
  71. #include "jc.h"
  72. #include "jt.h"
  73. #include "je.h"
  74.  
  75.  
  76. #if (SYS & SYS_LILENDIAN)
  77. #define XINF            "\000\000\000\000\000\000\360\177"
  78. #define XNAN            "\000\000\000\000\000\000\370\377"
  79. #endif
  80.  
  81. #if (SYS & SYS_MACINTOSH)
  82. #define XINF            "\177\377\000\000\000\000\000\000\000\000"
  83. #define XNAN            "\377\377\100\000\000\000\000\000\000\000"
  84. #endif
  85.  
  86. #ifndef XINF
  87. #define XINF            "\177\360\000\000\000\000\000\000"
  88. #define XNAN            "\377\370\000\000\000\000\000\000"
  89. #endif
  90.  
  91.  
  92. #ifndef PI
  93. #define PI              3.14159265358979323846
  94. #endif
  95. #ifndef LONG_MAX
  96. #define LONG_MAX        2147483647L
  97. #endif
  98. #ifndef LONG_MIN
  99. #define LONG_MIN        (~2147483647L)
  100. #endif
  101. #ifndef OVERFLOW
  102. #define OVERFLOW        8.988465674311578e307
  103. #endif
  104. #ifndef UNDERFLOW
  105. #define UNDERFLOW       4.450147717014403e-308
  106. #endif
  107.  
  108.  
  109. #define NALP            256             /* size of alphabet                */
  110. #define NINPUT          843             /* max # of chars in input line    */
  111. #define NOBUF           100             /* length of obuf                  */
  112. #define NPP             20              /* max value for quad pp           */
  113. #define NPROMPT         20              /* max length of immex prompt      */
  114. #define NTSTACK         2000L           /* size of stack for temps         */
  115. #define RMAX            127             /* max rank                        */
  116. #define RMAXL           127L            /* max rank, long                  */
  117.  
  118.  
  119. #define ABS(a)          (0<=(a)?(a):-(a))
  120. #define DO(n,stm)       {I i=0;I _n=(n); for(;i<_n;i++){stm}}
  121. #define EPILOG(z)       R gc(z,_ttop)
  122. #define F1(f)           A f(  w)A   w;
  123. #define F2(f)           A f(a,w)A a,w;
  124. #define F1RANK(m,f,self)    {RZ(   w); if(m<AR(w))            \
  125.                                  R rank1ex(  w,(A)self,(I)m,     f);}
  126. #define F2RANK(l,r,f,self)  {RZ(a&&w); if(l<AR(a)||r<AR(w))   \
  127.                                  R rank2ex(a,w,(A)self,(I)l,(I)r,f);}
  128. #define GA(v,t,n,r,s)   RZ(v=ga((I)(t),(I)(n),(I)(r),(I*)(s)))
  129. #define IC(w)           (AR(w) ? *AS(w) : 1L)
  130. #define JSPR(fmt,x)     {sprintf(obuf,fmt,x); jouts(obuf);}
  131. #define MAX(a,b)        ((a)>(b)?(a):(b))
  132. #define MIN(a,b)        ((a)<(b)?(a):(b))
  133. #define PROLOG          I _ttop=tbase+ttop
  134. #define R               return
  135. #define RE(exp)         {if((exp),jerr)R 0;}
  136. #define RZ(exp)         {if(!(exp))R 0;}
  137. #define SGN(a)          ((0<(a))-(0>(a)))
  138.  
  139.  
  140. #ifndef CLOCKS_PER_SEC
  141. #if (SYS & SYS_UNIX)
  142. #define CLOCKS_PER_SEC  1000000
  143. #endif
  144. #ifdef  CLK_TCK
  145. #define CLOCKS_PER_SEC  CLK_TCK
  146. #endif
  147. #endif
  148.  
  149. #if (WATERLOO)
  150. #define CLOCK           (m_cpu())
  151. #else
  152. #if (SYS & SYS_AMIGA)
  153. #define CLOCK           (time(0))
  154. #else
  155. #define CLOCK           ((D)clock()/CLOCKS_PER_SEC)
  156. #endif
  157. #endif
  158.  
  159. #if (SYS & SYS_AMIGA)
  160. #ifndef size_t
  161. #define size_t unsigned   /* why why why?? */
  162. #endif
  163. #endif
  164.  
  165. #define ASSERT(b,e)     {if(!(b)){jsignal(e); R 0;}}
  166.  
  167. #define EVBREAK         1
  168. #define EVDEFN          2
  169. #define EVDOMAIN        3
  170. #define EVILNAME        4
  171. #define EVILNUM         5
  172. #define EVINDEX         6
  173. #define EVFACE          7
  174. #define EVLENGTH        8
  175. #define EVLIMIT         9
  176. #define EVNONCE         10
  177. #define EVNOTASGN       11
  178. #define EVOPENQ         12
  179. #define EVRANK          13
  180. #define EVSPELL         14
  181. #define EVSYNTAX        15
  182. #define EVSYSTEM        16
  183. #define EVVALUE         17
  184. #define EVWSFULL        18
  185.  
  186. #define NEVM            18      /* number of event codes                   */
  187.  
  188.